package org.eenie.kdassistant;

import android.app.Application;

import com.blankj.utilcode.util.Utils;
import com.idescout.sql.SqlScoutServer;

import org.eenie.kdassistant.injector.components.AppComponent;
import org.eenie.kdassistant.injector.components.DaggerAppComponent;
import org.eenie.kdassistant.injector.modules.AppModule;
import org.eenie.kdassistant.utils.ToastUtils;

/**
 * Created by Eenie on 2017/8/1.
 * Email: eeniework@gmail.com
 * Des:
 */

public class App extends Application {

    private AppComponent mAppComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        ToastUtils.regist(this);
        inject();
        Utils.init(this);
        SqlScoutServer.create(this, getPackageName());
    }





    private void inject() {
        mAppComponent = DaggerAppComponent
                .builder()
                .appModule(new AppModule(this))
                .build();
        mAppComponent.inject(this);
    }


    public AppComponent getApplicationComponent() {
        return mAppComponent;
    }


}
